/** \file Momentum_t.cc 
 * Test definitions for the Momentum function.
 *
 * (C) Copyright by Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id: Momentum_t.cc 110 2006-06-19 03:38:33Z semihc $
 *
 *
 */


#include "Momentum.hpp"
#include <vector>
#include "TestHarness.hh"

using namespace std;
using namespace TC;


namespace {

  const unsigned DataSize = 56;

  const double data_cls[DataSize] = {
    13.0000, 12.6667, 12.6667, 12.6667, 13.0833, 14.0000, 14.1667,
    15.3333, 15.2500, 14.1667, 14.1667, 14.0000, 13.8333, 13.8333,
    14.3333, 15.1667, 15.5000, 16.0000, 17.0000, 16.5000, 16.0833,
    16.3333, 16.3333, 16.0000, 15.3333, 16.1667, 15.9167, 15.6667,
    15.6667, 16.6667, 15.8333, 15.8333, 16.5833, 16.8333, 17.3333,
    17.3333, 17.1667, 17.3333, 18.6667, 20.0000, 19.8333, 19.5000,
    19.3750, 19.0000, 19.2500, 19.0000, 18.2500, 17.6250, 17.0000,
    19.0000, 19.2500, 19.5000, 19.5000, 19.3750, 19.5000, 19.5000 };
  

  const double data_expect[DataSize] = {
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    106.4100, 109.2100, 113.1573, 119.7368, 118.4716, 114.2857, 119.9997,
    107.6089, 105.4643, 115.2936, 115.2936, 114.2857, 110.8434, 116.8680,
    111.0470, 103.2967, 101.0755, 104.1669,  93.1371,  95.9594, 103.1088,
    103.0612, 106.1225, 108.3331, 111.9570, 107.2161, 117.2775, 127.6593,
    126.5953, 116.9998, 122.3687, 120.0003, 116.0806, 112.8715, 105.2887,
    101.6829,  99.0289, 109.6156, 103.1248,  97.5000,  98.3195,   99.3590,
    100.6452,  102.6316 };

}


TEST(MomentumTest, Base)
{
     vector<TAfp_t> result;

     Momentum(data_cls, data_cls+DataSize,
	      back_inserter(result), 12,
              ArrayAdaptor<double>());

     TC_TEST(result.size()==DataSize);
     PrintElements(result, "Momentum");

     for(unsigned i=0; i<DataSize; ++i)
       if(data_expect[i] > 0)
         TC_TESTFP(data_expect[i], result[i]);

}

  



